//抽离路由模块
//1.导入 vue-router 包
import VueRouter from "vue-router"

//导入 HomeContainer 组件
import HomeContainer from "./components/tabbar/HomeContainer.vue"
//导入 MemberContainer 组件
import MemberContainer from "./components/tabbar/MemberContainer.vue"
//导入 SearchContainer 组件
import SearchContainer from "./components/tabbar/SearchContainer.vue"
//导入 ShopcarContainer 组件
import ShopcarContainer from "./components/tabbar/ShopcarContainer.vue"

//导入 NewList 组件
import NewList from "./components/news/NewList.vue"
//导入 NewsInfo 组件
import NewsInfo from "./components/news/NewsInfo.vue"

//导入 PhotoList 组件
import PhotoList from "./components/photos/PhotoList.vue"
//导入 PhotoInfo 组件
import PhotoInfo from "./components/photos/PhotoInfo.vue"

//导入 GoodsList 组件
import GoodsList from "./components/goods/GoodsList.vue"

//导入 GoodsInfo 组件
import GoodsInfo from "./components/goods/GoodsInfo.vue"
//导入 GoodsDesc 组件
import GoodsDesc from "./components/goods/GoodsDesc.vue"
//导入 GoodsComment 组件
import GoodsComment from "./components/goods/GoodsComment.vue"

//3.创建路由对象
var router= new VueRouter({
    routes: [//匹配路由规则
        { path: '/',redirect: '/home' },
        { path: '/home',component: HomeContainer},
        { path: '/member',component: MemberContainer},
        { path: '/search',component: SearchContainer},
        { path: '/shopcar',component: ShopcarContainer},
        { path: '/home/newslist',component: NewList},
        { path: '/home/newsinfo/:id', component: NewsInfo},
        { path: '/home/photolist', component: PhotoList},
        { path: '/home/photoinfo/:id', component:PhotoInfo},
        { path: '/home/goodslist',component: GoodsList },
        { path: '/home/goodsinfo/:id',component: GoodsInfo,name: 'goodsinfo'},
        { path: '/home/goodsdesc/:id',component: GoodsDesc, name: 'goodsdesc'},
        { path: '/home/goodscomment/:id',component: GoodsComment,name: 'goodscomment'}
        
    ],
    linkActiveClass: 'mui-active'
})

//向外暴露路由对象
export default router